package com.example.springboot01.mapper;

import com.example.springboot01.model.Student;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * @Auther: zrd
 * @Date: 2022/3/23/03/23/14:16
 * @Description: com.example.springboot01.mapper
 */
@Component
public interface StudentMapper2 {
    void insert(Student student);
    void delete(Long id);
    void update(Student student);
    List<Student> getAll();
    Student getOne(int id);

    /**
     * 嵌套方法查询
     * @param id
     * @return
     */
    Student SelectById(Long id);

    /**
     * 嵌套结果查询
     * @param id
     * @return
     */
    Student SelectById2(Long id);

    Student selectByCardId(Long id);


    /**
     * 根据班级id查询班级学生
     * @param classId:班级id
     * @return
     */
    List<Student> selectByClassId(int classId);

    /***
     * 一对多嵌套查询方式，查询带有学生属性的班级对象(一对多)
     * @param id
     * @return
     */
    Student selectByClassId1(int id);


}
